Technical Field
Embodiments described herein are related to the field of processors and, more particularly, to processors that execute predicated vector operations.
Description of the Related Art
Recent advances in processor design have led to the development of a number of different processor architectures. For example, processor designers have created superscalar processors that exploit instruction-level parallelism (ILP), multi-core processors that exploit thread-level parallelism (TLP), and vector processors that exploit data-level parallelism (DLP). Each of these processor architectures has unique advantages and disadvantages which have either encouraged or hampered the widespread adoption of the architecture. For example, because ILP processors can often operate on existing program code, these processors have achieved widespread adoption. However, TLP and DLP processors typically require applications to be manually re-coded to gain the benefit of the parallelism that they offer, a process that requires extensive effort. Consequently, TLP and DLP processors have not gained widespread adoption for general-purpose applications.
One significant issue affecting the adoption of DLP processors is the vectorization of loops in program code. In a typical program, a large portion of execution time is spent in loops. Unfortunately, many of these loops have characteristics that render them unvectorizable in existing DLP processors. Thus, the performance benefits gained from attempting to vectorize program code can be limited.
Conditional loop-carried dependencies (LCDs) complicate the vectorization of loops. An LCD is a dependency of a variable in a loop on a variable that is modified in a previous iteration of the loop. For example, a variable that is both a source and a destination of instructions in a loop can be an LCD. Since the value of the variable as a source in a given iteration of the loop is dependent on the result from the previous iteration of the loop, an LCD exists. Some LCDs are conditional, meaning that a dependency exists if a conditional expression evaluates in a certain way between iterations, but does not exist if a conditional expression evaluates in a different way between iterations. For example, instructions that are executed only if a condition is true can create a dependency in iterations where the condition evaluates to true but no dependency in iterations where the condition evaluates to false. Many possibilities for dependencies exist based on the evaluation of the expression in a previous iteration and the evaluation of the expression in the current iteration.